<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr = [1,2,'a','张'];
        console.table(arr);

        let name = ['zh','admin'];
        Object.freeze(name); // 冻结对象属性 使其不被修改
        name[1] = 'hehe';
        console.log(name);

        let arr1 = Array.of(6); // 使用of创建元素
        console.table(arr1);

        const strArr = arr.toString() // 将数组转为字符串
        console.log(strArr);
        // 将字符串转为数组
        let str = 'zhouwenhua';
        console.log(str.split('')); // ["z", "h", "o", "u", "w", "e", "n", "h", "u", "a"]
        // 数组from方法将有length属性的对象转为数组
        console.log(Array.from(str)); // ["z", "h", "o", "u", "w", "e", "n", "h", "u", "a"]
    </script>
</body>
</html>